import axios from "axios";
import service from "@/config/index";

const URLS = {
  DISABLE: `/tenant/user/disable`,
};
export default {
  disable (params) {
    return axios.put(URLS.DISABLE, params);
  },
  getUserInfo (userKeyId) {
    return axios.get(`/tenant/user/${userKeyId}`);
  },
  checkName (account) {
    return axios.get(`${service.serviceUser}/account/exits/${account}`);
  },
  // 手机验证码
  mobileCode (params) {
    return axios.post(`${service.serviceUser}/mobile/code`, params);
  },
  // 绑定手机
  bindMobile (params) {
    return axios.post(`${service.serviceUser}/mobile/bind`, params);
  },
  // 图形验证码
  graphicalValidate (params) {
    return axios.get(`${service.serviceUser}/captcha`, params);
  },
  // 普通用户修改密码
  revisePassword (params) {
    return axios.put(`${service.serviceUser}/password`, params);
  },
  // 判断用户是否有权限
  getPermission (params) {
    return axios.get(`${service.serviceUser}/permission`, params);
  },
  // 获取未读的消息通知
  getNotificationList (params) {
    return axios.get(`${service.serviceUser}/unread/notification/list`);
  },
  // 标记消息通知为已读未读状态
  changeNoticeRead (params) {
    return axios.put(`${service.serviceUser}/read/notification`, params);
  },
};
